#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:homework4_4.py
# author:wmf
# datetime:2021/4/12 14:33
# software: PyCharm
'''
this is function description
'''
# import module your need

import base64


def sign_in():
    name = input("请输入登录同学的姓名:")
    with open('secret.txt','r') as f:
        info = f.readlines()
        for x in info:
            Info = x.split(' ')
            Info[2] = str(base64.b64decode(Info[2].encode()))
            if Info[0] == name:
                num = input("请输入账号:")
                if Info[1] == num:
                    secret = input("请输入密码:")
                    if Info[2][2:len(Info[2])-1] == secret:
                        print("登录成功")
                        return
                    else:
                        print("登录失败,姓名错误")
                        return
                else:
                    print("登录失败,账号错误")
                    return
            else:
                print("登录失败,密码错误")
                return

sign_in()